package com.kafka.demo.service;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class KafkaReceiver {


    @KafkaListener(topics = {"${app.topic.kafkatest}"})
    public void receive(ConsumerRecord<?, ?> record){
        log.info("receive message: topic={},offset={},value={}", record.topic(), record.offset(), record.value());
    }


}
